using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class doctorMap : EntityTypeConfiguration<doctor>
    {
        public doctorMap()
        {
            // Primary Key
            this.HasKey(t => t.doctor_nb);

            // Properties
            this.Property(t => t.doctor_nb)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.name)
                .HasMaxLength(51);

            this.Property(t => t.sunfrom1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.sunto1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.sunfrom2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.sunto2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.sunfrom3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.sunto3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.monto1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.monfrom1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.monfrom2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.monto2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.monfrom3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.monto3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.tuefrom1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.tueto1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.tuefrom2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.tueto2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.tuefrom3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.tueto3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.wedfrom1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.wedto1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.wedfrom2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.wedto2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.wedfrom3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.wedto3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.thufrom1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.thuto1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.thufrom2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.thuto2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.thufrom3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.thuto3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.frifrom1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.frito1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.frifrom2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.frito2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.frifrom3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.frito3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.satfrom1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.satto1)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.satfrom2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.satto2)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.satfrom3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.satto3)
                .IsFixedLength()
                .HasMaxLength(8);

            this.Property(t => t.studentAName)
                .HasMaxLength(51);

            // Table & Column Mappings
            this.ToTable("doctors");
            this.Property(t => t.doctor_nb).HasColumnName("doctor_nb");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.sunfrom1).HasColumnName("sunfrom1");
            this.Property(t => t.sunto1).HasColumnName("sunto1");
            this.Property(t => t.sunfrom2).HasColumnName("sunfrom2");
            this.Property(t => t.sunto2).HasColumnName("sunto2");
            this.Property(t => t.sunfrom3).HasColumnName("sunfrom3");
            this.Property(t => t.sunto3).HasColumnName("sunto3");
            this.Property(t => t.monto1).HasColumnName("monto1");
            this.Property(t => t.monfrom1).HasColumnName("monfrom1");
            this.Property(t => t.monfrom2).HasColumnName("monfrom2");
            this.Property(t => t.monto2).HasColumnName("monto2");
            this.Property(t => t.monfrom3).HasColumnName("monfrom3");
            this.Property(t => t.monto3).HasColumnName("monto3");
            this.Property(t => t.tuefrom1).HasColumnName("tuefrom1");
            this.Property(t => t.tueto1).HasColumnName("tueto1");
            this.Property(t => t.tuefrom2).HasColumnName("tuefrom2");
            this.Property(t => t.tueto2).HasColumnName("tueto2");
            this.Property(t => t.tuefrom3).HasColumnName("tuefrom3");
            this.Property(t => t.tueto3).HasColumnName("tueto3");
            this.Property(t => t.wedfrom1).HasColumnName("wedfrom1");
            this.Property(t => t.wedto1).HasColumnName("wedto1");
            this.Property(t => t.wedfrom2).HasColumnName("wedfrom2");
            this.Property(t => t.wedto2).HasColumnName("wedto2");
            this.Property(t => t.wedfrom3).HasColumnName("wedfrom3");
            this.Property(t => t.wedto3).HasColumnName("wedto3");
            this.Property(t => t.thufrom1).HasColumnName("thufrom1");
            this.Property(t => t.thuto1).HasColumnName("thuto1");
            this.Property(t => t.thufrom2).HasColumnName("thufrom2");
            this.Property(t => t.thuto2).HasColumnName("thuto2");
            this.Property(t => t.thufrom3).HasColumnName("thufrom3");
            this.Property(t => t.thuto3).HasColumnName("thuto3");
            this.Property(t => t.frifrom1).HasColumnName("frifrom1");
            this.Property(t => t.frito1).HasColumnName("frito1");
            this.Property(t => t.frifrom2).HasColumnName("frifrom2");
            this.Property(t => t.frito2).HasColumnName("frito2");
            this.Property(t => t.frifrom3).HasColumnName("frifrom3");
            this.Property(t => t.frito3).HasColumnName("frito3");
            this.Property(t => t.satfrom1).HasColumnName("satfrom1");
            this.Property(t => t.satto1).HasColumnName("satto1");
            this.Property(t => t.satfrom2).HasColumnName("satfrom2");
            this.Property(t => t.satto2).HasColumnName("satto2");
            this.Property(t => t.satfrom3).HasColumnName("satfrom3");
            this.Property(t => t.satto3).HasColumnName("satto3");
            this.Property(t => t.studentAName).HasColumnName("studentAName");
        }
    }
}
